package com.cj.databse;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import java.util.List;

/**
 * Created by chenjian on 2019/3/6 13:11.
 */
@Dao
public interface PersonlDao {

    /* *//*
    @Query("SELECT * FROM " + Constant.TABLE_LABEL_INFO)
    List<LabelLibBean> getAllLabel();*/

    //" where labelName in (:labelName)"

    /**
     * 分页查询人像
     *
     * @return
     */
    @Query("SELECT * FROM " + Constant.TABLE_PERSON +" limit :pageNum*10,10" )
    List<PersonBean> getPersonByPage(int pageNum);


    /**
     * 查询所有人像
     *
     * @return
     */
    @Query("SELECT * FROM " + Constant.TABLE_PERSON  )
    List<PersonBean> getAllPerson();
    /**
     * 查询指定状态人员
     *
     * @return
     */
    @Query("SELECT * FROM " + Constant.TABLE_PERSON +"  where normal is (:normal)" + " limit :pageNum*10,10  " )
    List<PersonBean> getPersonByType(int pageNum, boolean normal);

    @Insert
    void insertPortrait(List<PersonBean> entities);

    @Insert
    void insertPortrait(PersonBean entities);

    @Delete
    void deletePortrait(List<PersonBean> list);

    @Delete
    void deletePortrait(PersonBean p);

    @Update
    void updatePortrait(PersonBean p);



}
